def run(params:list[str]):
    from transformers import pipeline
    import sys
    from ApiBase import apiBase

    try:
        #input_image = "https://farm5.staticflickr.com/4007/4322154488_997e69e4cf_z.jpg"
        input_image = apiBase.argv(1,"/data/bzmwork/softrobot/llm/codeqwen-7b/txt/ocr_recognition.jpg")
        out_image = apiBase.argv(2,"/data/bzmwork/softrobot/llm/codeqwen-7b/txt/picbria.jpg")

        pipe = pipeline("image-segmentation", model="briaai/RMBG-1.4", trust_remote_code=True)
        pillow_mask = pipe(input_image, return_mask = True) # outputs a pillow mask
        pillow_image = pipe(input_image) # applies mask on input and returns a pillow image
        #import cv2
        img_converted = pillow_image.convert('RGB')
        img_converted.save(out_image)
        #img_converted.save('test_save.png')
    finally:    
        apiBase.close()